package com.zzy.database.mapper;

import com.zzy.database.pojo.Loan;
import com.zzy.database.pojo.LoanPayment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface LoanMapper {
    // 创建新贷款
    int createLoan(Loan loan);

    // 更新贷款状态
    int updateLoanStatus(@Param("loanId") String loanId, @Param("amount") BigDecimal amount);

    //获取某个贷款的信息
    Loan getLoanById(@Param("loanId") String loanid);
    // 查询用户的所有贷款
    List<Loan> getLoansByCustomerId(@Param("customerId") String customerId);
    //查询某个贷款的所有还款信息
    List<LoanPayment> getLoanPayById(@Param("loanId") String loanId);
}
